package com.lzxuni.modules.onlineanswers.entity;

import java.util.ArrayList;
import java.util.Random;

public class RandomNum {


    public static void random(int count,int number){
        ArrayList<Integer> aL=new ArrayList<Integer>();
        for(int digit=0;digit<count;digit++){
            aL.add(digit);
            System.out.print(digit+"  ");
        }
        System.out.println();
        for(int result=0;result<9;result++){
            Random r=new Random();
            int a=r.nextInt(aL.size());
            System.out.print(aL.get(a)+",");
            aL.remove(a);
        }
        System.out.println();

    }

    public static int[] Rnumber(int count,int number){
        ArrayList<Integer> aL=new ArrayList<Integer>();
        int[] arr=new int[number];
        for(int digit=0;digit<count;digit++){
            aL.add(digit);
           // System.out.print(digit+"  ");
        }
      //  System.out.println();
        for(int result=0;result<number;result++){
            Random r=new Random();
            int a=r.nextInt(aL.size());
           // System.out.print(aL.get(a)+",");
            arr[result]=aL.get(a);
            aL.remove(a);
        }
       // System.out.println();
    return arr;
    }


}
